<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 500px;
            height: 200px;
            position: relative;
            border: 1px solid red;
            border-radius: 30px;
            padding: 80px 20px 20px;
        }

        button {
            position: absolute;
            top: 30px;
            left: 600px;
        }
    </style>
</head>

<body>
    <div>
    </div>
    <button class="ad">查看笑话</button>
    <script src="./jquery-1.12.4.js"></script>
    <script>
        function fn() {
            $('div').html('加载中...')
            $.ajax({
                url: 'https://api.ixiaowai.cn/tgrj/index.php',
                type: 'get',
                success: function (backData) {
                    // console.log(backData);
                    $('div').html(backData)
                }
            })
        }
        $('.ad').on('click', function () {
            fn()
        })
        fn()
        // $('.ad').trigger('click')
    </script>
</body>

</html>